package fashionshop.gui.common.context;

import fashionshop.dao.SystemDao;
import fashionshop.domain.Employee;

public class UserContext {
	
	private static UserContext instance;
	
	private UserContext(){
		
	}
	
	public static UserContext getInstance(){
		if(instance == null){
			instance = new UserContext();
		}
		return instance;
	}
	
	private Employee employee;
	
	public Employee getEmployee() {
		return employee;
	}
	
	public boolean employeeLogin(String username, String password){
		SystemDao systemDao = new SystemDao();
		Employee emp = systemDao.employeeLogin(username, password);
		if(emp != null){
			employee = emp;
			return true;
		}
		return false;
	}

}
